package com.dgut.test3.config;

import com.dgut.test3.bean.RegionStats;
import com.dgut.test3.service.GetData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class MyCommandLineRunner implements CommandLineRunner {
    Environment env;

    @Autowired
    GetData getData;

    public void CustomCommandLineRunner(Environment env){
        this.env= env;
    }

    @Override
    public void run(String... args) throws Exception {
        List<RegionStats> data = getData.fetchCoronaVirusData();

    }
}
